/*=====================================================
Critical Links
Auto Configuration Server

Authors:
	Rui Eduardo Gouveia Gil - r-gil@critical-links.com

Date: 2010
Version 0.1
=======================================================*/
#ifndef __HTTPJAVASCRIPT_H__
#define __HTTPJAVASCRIPT_H__

#include <rgcpp/structs/Map.h>
#include <rgcpp/tools/Encoder.h>
#include <rgcpp/structs/Types.h>
#include <rgcpp/tools/ToString.h>
#include <pion/net/WebService.hpp>
#include <rgcpp/utils/LogHandler.h>
#include <rgcpp/exceptions/RuntimeException.h>

#include "ACSConfig.h"
#include "httpd/HttpJavaScriptInterface.h"

namespace acs
{

class HttpJavaScript : public pion::net::WebService
{
	private:
		static rgcpp::Map<std::string,boost::shared_ptr<Invoker> > javaScriptMap;

	public:
		HttpJavaScript();
		~HttpJavaScript();

		virtual void operator()(pion::net::HTTPRequestPtr& request, pion::net::TCPConnectionPtr& tcpConn);

	private:
		static void initJavaScriptMap();
		static void generateJavaScriptFile();
};

}

#endif

